using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_PER.
    /// </summary>
    public class DM_PER
    {
              private Int32 _PerID;
      private string _PerName;
      private string _PerDes;
      private Int16 _PStatus;
      private Int32 _POrder;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetPerID; 
      public bool IsPerIDNullable   
      { 
	 get { return false;  } 
      }
      public Int32 PerID
      {
         get { return _PerID; }
         set 
	    { 
 		 _PerID = value;
		IsSetPerID = true;
 	    }
      }
    public bool IsSetPerName; 
    public bool IsPerNameNullable   
    { 
		get { return false;  } 
    }
    public string PerName
    {
        get{ return _PerName;  }
        set
		{
			_PerName = value;
			IsSetPerName = true;
		}
    }
    public bool IsSetPerDes; 
    public bool IsPerDesNullable   
    { 
		get { return false;  } 
    }
    public string PerDes
    {
        get{ return _PerDes;  }
        set
		{
			_PerDes = value;
			IsSetPerDes = true;
		}
    }
    public bool IsSetPStatus; 
    public bool IsPStatusNullable   
    { 
		get { return false;  } 
    }
    public Int16 PStatus
    {
        get{ return _PStatus;  }
        set
		{
			_PStatus = value;
			IsSetPStatus = true;
		}
    }
    public bool IsSetPOrder; 
    public bool IsPOrderNullable   
    { 
		get { return false;  } 
    }
    public Int32 POrder
    {
        get{ return _POrder;  }
        set
		{
			_POrder = value;
			IsSetPOrder = true;
		}
    }

        #endregion

        #region Constructors
        public DM_PER()
        {
            Reset();
        }
        public DM_PER(DM_PER obj)
        {
            	this._PerID = obj.PerID;
	this._PerName = obj.PerName;
	this._PerDes = obj.PerDes;
	this._PStatus = obj.PStatus;
	this._POrder = obj.POrder;
        }
        #endregion

        public void Reset()
        {
                     _PerID = EmptyValues.v_Int32;
         _PerName = EmptyValues.v_string;
         _PerDes = EmptyValues.v_string;
         _PStatus = EmptyValues.v_Int16;
         _POrder = EmptyValues.v_Int32;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["PerID"] is DBNull))
		{
			obj.PerID = (Int32)reader["PerID"];
		}
                if(!(reader["PerName"] is DBNull))
		{
			obj.PerName = (string)reader["PerName"];
		}
                if(!(reader["PerDes"] is DBNull))
		{
			obj.PerDes = (string)reader["PerDes"];
		}
                if(!(reader["PStatus"] is DBNull))
		{
			obj.PStatus = (Int16)reader["PStatus"];
		}
                if(!(reader["POrder"] is DBNull))
		{
			obj.POrder = (Int32)reader["POrder"];
		}
//            _PerID = (reader["PerID"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["PerID"];
//            _PerName = (reader["PerName"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PerName"];
//            _PerDes = (reader["PerDes"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["PerDes"];
//            _PStatus = (reader["PStatus"] is DBNull)?DalTools.EmptyValues.v_Int16:(Int16)reader["PStatus"];
//            _POrder = (reader["POrder"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["POrder"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Int32 PerID, string PerName, string PerDes, Int16 PStatus, Int32 POrder)
        {
                     this._PerID = PerID;
         this._PerName = PerName;
         this._PerDes = PerDes;
         this._PStatus = PStatus;
         this._POrder = POrder;
        }
    }
}